package thread;
class Single{
    private static Single instance = new Single();
    public   static  Single getInstance(){
        return instance;
    }
    private Single(){

    }
}
class  Single2{
    private static volatile Single2 instance = null;
    private static Object locker = new Object();
    public static Single2 getInstance(){
       if(instance==null){
           synchronized (locker){
               if(instance==null){
                   instance = new Single2();
               }
           }
       }
        return instance;
    }
}
public class Text1 {
}
